No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without permission in writing from the publisher. However, you are permitted to make copies of this work, printed or otherwise, as long as said copies are for your personal use only.
Introduction
------------
MicroPhone's script language has a wealth of functions, each of which serves a specific purpose. We take a look at a handful of functions and come up with some real world examples of how to use them.
FillStr
-------
Use this function when you want to fill something with a repetitive series of information. For example, if you want to have the words "Hello World" appear on your screen 30 times, you could use a script like this:
Send Local to Screen "FillStr('Hello World',30)"
ItemCount
---------
Use this function when you want to count how many times a specific text string appears in a larger string, delimited by a certain character. For example, if your string is 'a,b,c,d,e' and your delimiter is a comma, ItemCount would return 5, since there are five items delimited by a comma.
ItemDelete
----------
Use this function when you want to delete a string that appears in a larger string. For example, if your string is 'a,b,c,d,e' and you want to delete the third item, use a script like this:
Set Variable itemList from Expression "ItemDelete(itemList,',',3)"
ItemFetch
---------
Use this function when you want to retrieve a string that appears in a larger string. For example, if your string is 'a,b,c,d,e' and you want to retrieve the third item, use a script like this:
Set Variable myItem from Expression "ItemFetch('a,b,c,d,e',',',3)"
ItemReplace
-----------
Use this function when you want to replace a string that appears in a larger string. For example, if your string is 'a,b,c,d,e' and you want to replace the third item with 'x', use a script like this:
Set Variable itemList from Expression "ItemReplace('x',itemList,',',3)"